﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PetaPoco;

namespace BrnMall.Manager.Domain.Distribution
{
    /// <summary>
    /// 分销商
    /// </summary>
    [TableName("dis_distributor")]
    public class Distributor
    {
        public int Id { get; set; }
        /// <summary>
        /// 用户ID
        /// </summary>
        public int UserId { get; set; }
        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreId { get; set; }
        /// <summary>
        /// 显示Logo
        /// </summary>
        public string ShowLogo { get; set; }

        /// <summary>
        /// 上级总代理商ID
        /// </summary>
        public int AgentDId { get; set; }
        /// <summary>
        /// 等级
        /// </summary>
        public int GradeId { get; set; }
        /// <summary>
        /// 上级分销商ID
        /// </summary>
        public int ParentId { get; set; }
        /// <summary>
        /// 分销等级
        /// </summary>
        [Ignore]
        public int DisLevel { get; set; }

        /// <summary>
        /// 路径
        /// </summary>
        public string Path { get; set; }
        /// <summary>
        /// 订单总额
        /// </summary>
        public decimal OrdersTotal { get; set; }
        /// <summary>
        /// 订单数量
        /// </summary>
        public int OrdersCount { get; set; }
        /// <summary>
        /// 佣金额度
        /// </summary>
        public decimal AccountBalance { get; set; }
        /// <summary>
        /// 历史提现额度
        /// </summary>
        public decimal RequestBalance { get; set; }
        /// <summary>
        /// 是否总代理，总代理提成所有分销商额度
        /// </summary>
        public int IsAgent { get; set; }

        /// <summary>
        /// 状态0:待审核，1：已审核，2：已关闭
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 分销店铺名称
        /// </summary>
        public string DisStoreName { get; set; }
        /// <summary>
        /// 联系人
        /// </summary>
        public string LinkMan { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string PhoneNumber { get; set; }
       

        /// <summary>
        /// 
        /// </summary>
        public Distributor()
        {
            Id = 0;
            UserId = 0;
            StoreId = 0;
            AgentDId = 0;
            GradeId = 0;
            ParentId = 0;
            Path = string.Empty;
            OrdersTotal = OrdersCount = 0;
            AccountBalance = RequestBalance = IsAgent =Status= 0;
            ShowLogo = string.Empty;
            CreateTime=new DateTime(1900,1,1);
            DisStoreName = LinkMan = PhoneNumber = string.Empty;
        }
    }
}
